if ( $label == '' ) {
$label = $title->getPrefixedText();
}
+ $repoGroup = MediaWikiServices::getInstance()->getRepoGroup();
$currentExists = $time
- && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title ) !== false;
+ && $repoGroup->findFile( $title ) !== false;
if ( ( $wgUploadMissingFileUrl || $wgUploadNavigationUrl || $wgEnableUploads )
&& !$currentExists
) {
- if ( RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title ) ) {
+ if ( $repoGroup->getLocalRepo()->checkRedirect( $title ) ) {
// We already know it's a redirect, so mark it accordingly
return self::link(
$title,
}
$toTalk = $toTitle->getTalkPageIfDefined();
+ $repoGroup = MediaWikiServices::getInstance()->getRepoGroup();
if ( $toTitle->getNamespace() == NS_FILE
- && !RepoGroup::singleton()->getLocalRepo()->findFile( $toTitle )
- && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $toTitle )
+ && !$repoGroup->getLocalRepo()->findFile( $toTitle )
+ && $repoGroup->findFile( $toTitle )
) {
if ( !$params['ignorewarnings'] &&
$this->getPermissionManager()->userHasRight( $user, 'reupload-shared' ) ) {
// mediawiki.special.movePage module
$immovableNamespaces = [];
+ $namespaceInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) {
- if ( !MediaWikiServices::getInstance()->getNamespaceInfo()->isMovable( $nsId ) ) {
+ if ( !$namespaceInfo->isMovable( $nsId ) ) {
$immovableNamespaces[] = $nsId;
}
}
return;
}
+ $services = MediaWikiServices::getInstance();
+
# Show a warning if the target file exists on a shared repo
+ $repoGroup = $services->getRepoGroup();
if ( $nt->getNamespace() == NS_FILE
&& !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) )
- && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt )
- && MediaWikiServices::getInstance()->getRepoGroup()->findFile( $nt )
+ && !$repoGroup->getLocalRepo()->findFile( $nt )
+ && $repoGroup->findFile( $nt )
) {
$this->showForm( [ [ 'file-exists-sharedrepo' ] ] );
// Delete an associated image if there is
if ( $nt->getNamespace() == NS_FILE ) {
- $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
- ->newFile( $nt );
+ $file = $repoGroup->getLocalRepo()->newFile( $nt );
$file->load( File::READ_LATEST );
if ( $file->exists() ) {
$file->delete( $reason, false, $user );
$this->moveTalk = false;
}
if ( $this->moveSubpages ) {
- $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+ $permissionManager = $services->getPermissionManager();
$this->moveSubpages = $permissionManager->userCan( 'move-subpages', $user, $ot );
}
*/
// @todo FIXME: Use Title::moveSubpages() here
- $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo();
+ $nsInfo = $services->getNamespaceInfo();
$dbr = wfGetDB( DB_MASTER );
if ( $this->moveSubpages && (
$nsInfo->hasSubpages( $nt->getNamespace() ) || (